/**
 * \* Created with IntelliJ IDEA.
 * \* User: 冯若航
 * \* Date: 2021/7/1
 * \* Time: 17:51
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class 反转数组 {
    /**
     * 这个可以用于将java提供的Arrays.sort()的默认由小到大变成由大到小
     * @param nums
     */
    void reverse(int[] nums){
        int left=0;
        int right=nums.length-1;
        while (left<right){
            int temp=nums[left];
            nums[left]=nums[right];
            nums[right]=temp;
            left++;right--;
        }
    }
}